package com.sigmazero13.MKDummy.components;

import android.content.Context;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.TextView;

import com.sigmazero13.MKDummy.R;
import com.sigmazero13.MKDummy.models.CardDeck;

public class CardDisplayTextRemainingView extends CardDisplayView {
	
	TextView remaining;

	public CardDisplayTextRemainingView(Context c) {
		super(c);
		
		commonSetup(c);
	}

	public CardDisplayTextRemainingView(Context c, AttributeSet attrs) {
		super(c, attrs);
		
		commonSetup(c);
	}
	
	@Override
	public void onDeckChanged(CardDeck deck) {
		remaining.setText(deck.countCardsRemaining().toString());
	}
	
	
	private void commonSetup(Context c) {
		LayoutInflater inflater = (LayoutInflater)c.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
		View main = inflater.inflate(R.layout.player_data_count_by_remaining, this, true);
		
		remaining = (TextView)main.findViewById(R.id.count_remaining);
	}

}
